gtk-demo: Use style classes in the settings demo
authorMatthias Clasen <mclasen@redhat.com>
Sun, 9 Aug 2020 12:28:29 +0000 (08:28 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 13 Aug 2020 20:30:22 +0000 (16:30 -0400)
Use .navigation-sidebar on the left, and .data-table
on the right.

demos/gtk-demo/listview_settings.c
demos/gtk-demo/listview_settings.ui

index 3bb674117bfd639e54dcbdb279db2591d464b4a9..9e5b3029d722f936b28bb856c896b15ad7ef7c8d 100644 (file)
@@ -5,6 +5,10 @@
  * It demonstrates how to implement support for trees with GtkListView.
  * It also shows how to set up sorting and filtering for columns in a
  * GtkColumnView.
+ *
+ * It also demonstrates different styles of list. The tree on the left
+ * uses the ­.navigation-sidebar style class, the list on the right uses
+ * the ­.data-table style class.
  */
 
 #include <gtk/gtk.h>
index f428d6b4ddf18de1d5c382c098c87c148455b467..35c3c79c9849104f87d08bbb9dc959dcd631427d 100644 (file)
@@ -20,6 +20,9 @@
           <object class="GtkScrolledWindow">
             <child>
               <object class="GtkListView" id="listview">
+                <style>
+                  <class name="navigation-sidebar"/>
+                </style>
                 <property name="factory">
                   <object class="GtkBuilderListItemFactory">
                     <property name="bytes"><![CDATA[
@@ -73,6 +76,9 @@
                 <property name="vexpand">1</property>
                 <child>
                   <object class="GtkColumnView" id="columnview">
+                    <style>
+                      <class name="data-table"/>
+                    </style>
                     <child>
                       <object class="GtkColumnViewColumn" id="name_column">
                         <property name="title">Name</property>